Allow symlog to be adjusted for region of linearity #39
Merged
Demonstrandum merged 14 commits intoFeb 16, 2026
Conversation
|
Cursor Agent can help with this pull request. Just |
9684016 to
654b7e4
Compare
Preview Deployment
Details
|
Add a symlogLinearThreshold parameter to the symmetric log scale that controls the width of the linear region near zero. The formula changes from sign(x) * log10(|x| + 1) to sign(x) * log10(|x|/c + 1), where c is the threshold. - c = 1 (default): linear near |x| < 1 (current behavior) - c = 10: linear near |x| < 10 - c = 0.01: linear near |x| < 0.01 Changes: - Scale layer: SymLog10Scale accepts linearThreshold in constructor - createScale() accepts optional symlogLinearThreshold parameter - MetricsSettings: new symlogLinearThreshold field (default 1) - Action: metricsChangeSymlogLinearThreshold - Reducer/Selector: handle the new setting - Settings pane: numeric input for the threshold - LineChartComponent: new symlogLinearThreshold input, rebuilds scales - Scalar card: threads threshold from store → container → component → chart - Superimposed card: threads threshold similarly - Legacy symlog-scale.ts: updated for consistency - PersistableSettings: threshold persisted to backend settings - Scale tests: new test suite for custom threshold values Closes #34 Co-authored-by: Samuel <samuel@knutsen.co>
- Add symlogLinearThreshold field to ProfileData interface - Include threshold in profile save/load effects - Pass threshold when activating profiles - Add symlog_linear_threshold param to Python profile_writer - Update profileMetricsSettingsApplied action to carry threshold Co-authored-by: Samuel <samuel@knutsen.co>
Co-authored-by: Samuel <samuel@knutsen.co>
Ensure the threshold is properly serialized to/from backend settings storage (localStorage) via OSSSettingsConverter. Co-authored-by: Samuel <samuel@knutsen.co>
Co-authored-by: Samuel <samuel@knutsen.co>
…nent Co-authored-by: Samuel <samuel@knutsen.co>
Co-authored-by: Samuel <samuel@knutsen.co>
…rofile effects Only set symlogLinearThreshold on the action payload when the profile field is defined, avoiding passing undefined to an optional property which violates exactOptionalPropertyTypes. Co-authored-by: Samuel <samuel@knutsen.co>
…lStorage survival Co-authored-by: Samuel <samuel@knutsen.co>
Each scalar card and superimposed card now has a 'Symlog threshold' submenu in the overflow menu (three-dot icon). Users can type a per-card threshold value, or reset to use the global default. The menu shows the current effective value with an asterisk (*) when a per-card override is active. The 'Reset to global' button clears the override. This follows the same local-state pattern as yScaleType and xScaleTypeOverride — per-card state lives on the component instance. Co-authored-by: Samuel <samuel@knutsen.co>
6867ef8 to
d1e435d
Compare
…rofiles Replace the local component-state symlogLinearThresholdOverride with a fully store-backed per-tag system that mirrors how tagAxisScales works: - MetricsNonNamespacedState: new tagSymlogLinearThresholds record - Action: metricsTagSymlogLinearThresholdChanged (tag + threshold) - Reducer: updates tagSymlogLinearThresholds record - Selectors: getTagSymlogLinearThresholds, getEffectiveTagSymlogLinearThreshold(tag) - localStorage: extends StoredAxisScalesV1 with symlogLinearThreshold and tagSymlogLinearThresholds fields, persisted alongside axis scales - Containers: select getEffectiveTagSymlogLinearThreshold(tag) per card, dispatch metricsTagSymlogLinearThresholdChanged on user input - Components: emit @output() instead of mutating local state - Profile types: tagSymlogLinearThresholds field on ProfileData - Profile effects: save/load per-tag thresholds with profiles - Python profile_writer: tag_symlog_linear_thresholds parameter Co-authored-by: Samuel <samuel@knutsen.co>
…ard_container Co-authored-by: Samuel <samuel@knutsen.co>
…scalar_card_container" This reverts commit 770257b.
Co-authored-by: Samuel <samuel@knutsen.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for features / changes
This PR addresses issue #34, allowing users to configure the linear threshold for the symmetric log (SYMLOG10) scale. Previously, the SYMLOG10 scale used a fixed linear region for
|x| < 1. This change introduces alinearThresholdparameterc, making the scale approximately linear for|x| < c. This provides greater flexibility for visualizing data with varying magnitudes near zero.Technical description of changes
SymLog10ScaleandcreateScaleinscale.tsto accept alinearThresholdparameter (default 1). The transformation formula is updated tosign(x) * log10(|x|/c + 1). The legacysymlog-scale.tswas also updated for consistency.symlogLinearThresholdtoMetricsSettings,METRICS_SETTINGS_DEFAULT, and introduced a new actionmetricsChangeSymlogLinearThreshold. Reducers and selectors were updated to manage this new setting.symlogLinearThresholdinput was threaded throughLineChartComponent,ScalarCardComponent,ScalarCardContainer,SuperimposedCardComponent, andSuperimposedCardContainerto ensure the setting is applied to all relevant charts.symlogLinearThresholdwas added toBackendSettingsandPersistableSettingsinterfaces, and serialization/deserialization logic was updated inpersistent_settings_data_source.tsto ensure the setting persists across sessions.symlogLinearThresholdwas added toProfileDataandcreateEmptyProfile. Profile effects were updated to save and restore this setting when profiles are activated or saved. The Pythonprofile_writer.pywas also updated to acceptsymlog_linear_threshold.scale_test.tsto verify the behavior ofSymLog10Scalewith customlinearThresholdvalues, including forward/reverse consistency, linear region behavior, niceDomain, and ticks.AGENTS_DEV.mdto reflect the new feature and its usage.Screenshots of UI changes (or N/A)
A new "Symlog Linear Threshold" input field has been added to the "Scalars" section of the settings pane.
Detailed steps to verify changes work correctly (as executed by you)
symlogLinearThresholdin the UI, then refresh the page or close/reopen TensorBoard. Confirm the setting is retained.symlogLinearThreshold.symlogLinearThresholdis included in the saved profile data.symlogLinearThreshold(e.g., 0.1, 1, 10) and observe how the linear region near zero changes, making small values more or less spread out.npm testto ensure all existing and new scale tests pass, specifically checking thesymlog10 with custom linearThresholdsuite.Alternate designs / implementations considered (or N/A)
N/A